The present invention relates generally to audio decoders, such as may be used in portable music players or other multimedia devices. An audio decoder may be used to decode stored audio files, or to decode a stream of data provided over a network.
A variety of standards for encoding audio are known. In addition, a variety of standards for encapsulating encoded audio data into a data stream (which may include a data file or a stream of data provided over a network) are also known. One example of the latter is the Audio Data Transport Stream (ADTS) format, which is commonly used to encapsulate and transport audio data encoded according to the widely-used Advanced Audio Coding (AAC) standard.
ADTS and other formats organize a data stream into frames of audio data, each frame including a header. In some applications, it may be necessary to scan a portion of the data stream to find the beginning of an encoded audio frame. So-called syncwords are commonly included in frame headers to facilitate this scanning. A syncword is a fixed-length, fixed-value data field, generally placed in a consistent position within a header, such as the beginning of the header.
Although scanning a data stream to detect occurrences of the syncword is generally effective to locate frame headers, errors may occur. Because a syncword is generally limited for practical reasons to a relatively short length, such as 12 bits, an apparent syncword may occasionally appear in the audio payload data, i.e. outside a frame header. This occurrence will result in a false detection of a frame. While various techniques for recovering from such a false detection are possible, false detections result in the use of valuable processing time and cycles.
Accordingly, a method for effectively locating frame boundaries in a data stream of encoded audio frames, while reducing false detections, is needed.